                            <!-- right content-->
                            <?php
                            $allCategory = $this->allCategory;
                            $catID = $this->catID;
                            $currentCat = @$allCategory[$catID];
                            $cat = new Category();
                            
                            /*
                            // update curentCat if it's sub-cat
                            if ($currentCat['parent'] != 1) {
                                @$parentID = $currentCat['parent'];
                                
                                @$currentCat = $allCategory[$parentID];
                                @$allChild = $currentCat['children'];
                            }
                            */
                            ?>
                            <div style="padding:5px; border:1px solid #000;">
                                Search &raquo;
                                <?php echo $this->key?>
                            </div>
                            <?php
                            // update curentCat if it's sub-cat
                            if ($currentCat['parent'] != 1) {
                                @$parentID = $currentCat['parent'];
                                
                                @$currentCat = $allCategory[$parentID];
                                @$allChild = $currentCat['children'];
                            }
                            ?>
                            <!-- space-->
                            <div style="padding:5px; "></div>
                            <!-- end space-->
                            <table width="100%">
                                <tr>
                                <?php
                                if(@$currentCat['main_image']) {
                                    $image = @$currentCat['main_image'];
                                    //echo stripos($image, 'http');
                                    
                                    if (stripos($image, 'http') === false) {
                                        $image = BASE_PATH . $image;
                                    } else {
                                        //echo $image = BASE_PATH . $image;
                                        // do nothing
                                    }
                                ?>
                                    <td>
                                        <center>
                                        <?php
                                        if(@$currentCat['photo_link']) {
                                        ?>
                                        <a href="<?php echo $currentCat['photo_link']?>">
                                            <img src='<?php echo htmlspecialchars($image);?>'>
                                        </a>
                                        <?php
                                        } else {
                                        ?>
                                            <img src='<?php echo htmlspecialchars($image);?>'>
                                        <?php
                                        }
                                        ?>
                                        </center>
                                    </td>
                                <?php
                                }
                                ?>
                                <?php
                                if(@$currentCat['embed_youtube']) {
                                ?>
                                    <td width="260">
                                    <?php echo @$currentCat['embed_youtube'];?>
                                    </td>
                                <?php
                                }
                                ?>
                                </tr>
                            </table>
                            <div style="padding: 10px 0px;">
                            <?php echo @$currentCat['description']?>
                            </div>
                            
                            
                            <!-- List product-->
                            <div id="listproduct">
                                    <?php
                                    //print_r($currentCat);
                                    ?>
                                        <?php
                                        
                                        @$allChild = $currentCat['children'];
                                        
                                        
                                        $objCat = new Category();
                                        if (count($allChild) > 0) {
                                        ?>
                                <div style="float:left;">
                                    <form method="post" action="">
                                        <span style="color:#FFF;">Sort By Sub-Category</span>
                                        <select onchange="document.location.href=this.options[this.selectedIndex].value;">
                                        <option value="<?php echo $objCat->url($currentCat)?>">--select one--</option>
                                        <?php
                                            foreach($allChild as $childID):
                                                $cat = $allCategory[$childID];
                                        ?>
                                            <option value="<?php echo $objCat->url($cat)?>" <?php if($this->catID == $cat['category_id']) echo "selected";?>><?php echo $cat['admin_title']?></option>
                                        <?php
                                            endforeach;
                                        ?>
                                        </select>
                                    </form>
                                </div>
                                <div style="float:right;">
                                    <a href="<?php echo BASE_URL?>/index/shop/list/?cid=<?php echo $currentCat['category_id']?>&all=1">See all <?php echo @$currentCat['admin_title']?> products</a>
                                </div>
                                        <?php
                                        } else {
                                        ?>
                                            <span style="color:#FFF;">List products</span>
                                        <?php
                                        }
                                        ?>
                                <div style="clear:both;"></div>
                            </div>
                            <table width="100%" cellspacing="0" cellpadding="0" id="products">
                                <tr>
                            <?php
                                $allItems = $this->allItems;
                                $currentPage = $this->currentPage;
                            ?>
                            <?php
                            if (isset($allItems[0])) {
                                $i = 0;
                                $itemPerRow = 4;
                                $widthPercent = 100/$itemPerRow;
                                foreach($allItems as $item):
                                    if ( ($i++ % $itemPerRow == 0) && ($i != 1)) {
                                ?>
                                    </tr>
                                    <tr>
                                <?php
                                    }
                                ?>
                                    <td width="<?php echo $widthPercent?>%">
                                        <div>
                                            <a title="<?php echo htmlspecialchars($item->Product); ?>" class="thumbnail" href="<?php echo BASE_URL ?>/index/shop/detail?pid=<?php echo $item->category_id; ?>&id=<?php echo $item->ProductNo; ?>"><?php echo $item->Product; ?></a>
                                        </div>
                                        <?php
                                        $Thumbnail = $item->Thumbnail;
                                        if ($Thumbnail) {
                                            if (stripos($Thumbnail, 'http') === false) {
                                        $Thumbnail = BASE_PATH . $Thumbnail;
                                    } else {
                                        //echo $image = BASE_PATH . $image;
                                        // do nothing
                                    }
                                        //$path = pathinfo($item->Thumbnail, PATHINFO_DIRNAME);
                                        //$fileName = pathinfo($item->Thumbnail, PATHINFO_BASENAME);
                                        ?>
                                        <div style="padding: 10px 0px">
                                            <a title="<?php echo htmlspecialchars($item->Product); ?>" class="thumbnail" href="<?php echo BASE_URL ?>/index/shop/detail?pid=<?php echo $item->category_id; ?>&id=<?php echo $item->ProductNo; ?>"><img style="max-height: 80px;" alt="<?php echo htmlspecialchars($item->Product); ?>" src="<?php echo htmlspecialchars($Thumbnail)?>"></a>
                                        </div>
                                        <?php
                                        }
                                        ?>
                                        <div>
                                        Price - <strong style="color:red"><?php echo $item->Price?></strong>
                                        </div>
                                        <div style="padding-bottom:20px">
                                            <a title="<?php echo htmlspecialchars($item->Product); ?>" class="thumbnail" href="<?php echo BASE_URL ?>/index/shop/detail?pid=<?php echo $item->category_id; ?>&id=<?php echo $item->ProductNo; ?>"><img alt="More Info" src="<?php echo JS_PATH?>/skincarebyalana/images/moreInfo.png"/></a>
                                            <?php 
                                            if ($item->Price) { // just show buy button if price enter in admin 
                                                if ($item->AuthReq != "Yes") { // add login later
                                                ?>
                                                    
                                                        <img alt="More Info" src="<?php echo JS_PATH?>/skincarebyalana/images/buyit.gif" rel="<?php echo $item->ProductNo; ?>" class="buynow">
                                                    
                                                <?php
                                                } // if AuthReq
                                            }
                                            ?>
                                        </div>
                                    </td>
                                <?php
                                endforeach;
                            } // if items
                            ?>
                                </tr>
                            </table>
                            <?php echo $this->paging?>
                            <!-- End List product-->